import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'author.dart';
import '../../routes/routes.dart';
import '../../shared/shared.dart';
import '../../widgets/widgets.dart';

class AuthorPage extends GetView<AuthorLogic> {
  const AuthorPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    SizeConfig().init(context);
    return WillPopScope(
        child: Scaffold(
            backgroundColor: ColorConstants.primaryColor, body: startMain()),
        onWillPop: () async => false);
  }

  Container startMain() {
    return Container(
        alignment: Alignment.center,
        margin: const EdgeInsets.only(top: 137),
        child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [_buildLogo(), _blindButton()]));
  }

  BlindButton _blindButton() {
    return BlindButton(
        onTap: () =>
            Get.toNamed(Routes.author + Routes.gender, arguments: controller),
        width: 131,
        height: 48,
        text: '开启旅程',
        fontSize: 20,
        color: ColorConstants.primaryColor);
  }

  Container _buildLogo() {
    return Container(
        margin: const EdgeInsets.only(bottom: 20),
        child: const Image(
            image: AssetImage('assets/images/IMG_1830.PNG'),
            width: 137,
            height: 137));
  }
}
